home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Think Class Libraries / SAT-TCL 1.0b2 / SAT-TCLBouncingDemo ƒ / BDIntf.p < prev    next >
Encoding:
Text File  |  1996-06-05  |  2.4 KB  |  107 lines  |  [TEXT/PJMM]

  1. {****************************************************}
  2. {}
  3. {    BDIntf.p                                                                                                        }
  4. {}
  5. {    Interface file for SAT-TCL Bouncing Demonstration of SAT-TCL.                    }
  6. {}
  7. {    Copyright © 1996 by Patrick C Hew. All rights reserved.                                }
  8. {}
  9. {****************************************************}
  10.  
  11.  
  12. unit BDIntf;
  13.  
  14. interface
  15.  
  16.     uses
  17.         TCL, GameIntf, SAT, SATTCLIntf, BDGlobals, sBouncer;
  18.  
  19.     const
  20.  
  21.         { Command IDs. }
  22.  
  23.         cmdStart = 3000;
  24.         cmdPause = 3001;
  25.         cmdResume = 3002;
  26.         cmdAbort = 3003;
  27.  
  28.         { Resource IDs. }
  29.  
  30.         PICTColorBackground = 128;
  31.         PICTBWBackground = 129;
  32.  
  33.         WINDBD = 500;        { Resource ID for WIND template             }
  34.  
  35.  
  36. {****************************************************}
  37. {}
  38. {    CBDApp                                                                                                        }
  39. {}
  40. {    Application class for BD.                                                                                }
  41. {}
  42. {****************************************************}
  43.  
  44.     type
  45.         CBDApp = object(CGameApp)
  46.  
  47.                 { Initialize an BD Application object. }
  48.                 procedure IBDApp;
  49.  
  50.                 { Implements a very simple About box. }
  51.                 procedure DoCommand (theCommand: longint);
  52.                 override;
  53.  
  54.             end; { CBDApp }
  55.  
  56.  
  57. {****************************************************}
  58. {}
  59. {    CBDDirector                                                                                                }
  60. {}
  61. {    Director class for BD.                                                                                    }
  62. {}
  63. {    Note that when the SAT Pane is not scrolled or shifted in its window, there    }
  64. {    is no need to call PrepareForSATRun.                                                                }
  65. {}
  66. {****************************************************}
  67.  
  68.     type
  69.         CBDDirector = object(CSATDirector)
  70.  
  71.                 { Flags for whether we are currently playing or paused. }
  72.                 isPlaying, isPaused: Boolean;
  73.  
  74.                 { Pointer to the application, to tell it to switch to game mode and back. }
  75.                 itsGameApp: CGameApp;
  76.  
  77.                 { Initialize an BD Director object. }
  78.                 procedure IBDDirector (aSupervisor: CGameApp);
  79.  
  80.                 { We reset our private pointer to the application. }
  81.                 procedure Free;
  82.                 override;
  83.  
  84.                 { We build a fixed size window which has one pane , the SAT pane . }
  85.                 procedure BuildWindow;
  86.                 override;
  87.  
  88.                 { Set up the sprites for the bouncer. }
  89.                 procedure SetUpSprites;
  90.  
  91.                 { Enables the appropriate commands in the Game Menu. }
  92.                 procedure UpdateMenus;
  93.                 override;
  94.  
  95.                 { React to commands to start, pause, resume or abort the game. }
  96.                 procedure DoCommand (theCommand: longint);
  97.                 override;
  98.  
  99.                 { When playing, this is the heart of the game loop. }
  100.                 procedure Dawdle (var maxSleep: longint);
  101.                 override;
  102.  
  103.             end; { CBDirector }
  104.  
  105. implementation
  106.  
  107. end. { BDIntf }